package com.jk.lzy.controller;

import com.jk.lzy.model.EmpBean;
import com.jk.lzy.service.EmpService;
import com.jk.lzy.service.SumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @Author: 梁展艺
 * @Description:
 * @Date: 2021/5/16 18:42
 * @param null
 * @Return:
 **/
@RestController
//@RequestMapping("emp")
public class EmpController implements SumService {
    @Autowired
    private EmpService empService;
    /**
     * @Author: 梁展艺
     * @Description:  查询
     * @Date: 2021/5/16 19:22
     * @param emp
     * @Return: java.util.HashMap<java.lang.String,java.lang.Object>
     **/
    //@RequestMapping("findEmp")
    public HashMap<String,Object> findEmp(EmpBean emp){
        return empService.findEmp(emp);
    }
    /**
     * @Author: 梁展艺
     * @Description: 新增
     * @Date: 2021/5/16 19:22
     * @param null
     * @Return:
     **/
   // @RequestMapping("insertEmp")
    //@ResponseBody
    public void insertEmp(@RequestBody EmpBean emp){
        empService.insertEmp(emp);
    }

    /**
     * @Author: 梁展艺
     * @Description:  删除
     * @Date: 2021/5/16 19:26
     * @param null
     * @Return:
     **/
    //@RequestMapping("deleteEmp")
   // @ResponseBody
    public void deleteEmp(Integer id){
        empService.deleteEmp(id);
    }
    /**
     * @Author: 梁展艺
     * @Description:  修改 回显
     * @Date: 2021/5/16 19:30
     * @param id
     * @Return: com.jk.lzy.model.EmpBean
     **/
    //@RequestMapping("updateEmpFindId")
   // @ResponseBody
    public EmpBean updateEmpFindId(Integer id){
        return empService.updateEmpFindId(id);
    }
}
